<template>
  <div class="course-comment">
    <div class="course-comment-item" v-for="(item,i) in data" :key="'comment' + i">
      <div class="item-l">
        <img :src="item.avatar" />
        <div class="info">
          <h3 class="title">{{item.name}}</h3>
          <p class="desc">{{item.content}}</p>
        </div>
      </div>
      <div class="item-r">
        <span class="title">评分</span>
        <div class="star">
         <img src="@/assets/home/star.png" v-for="(n,m) in Math.ceil(item.star)" :key="'star' + m" />
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: ['data'],
  data () {
    return {}
  }
}
</script>
<style lang="less" scoped>
.course-comment {
  &-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
    cursor: pointer;
    .item-l {
      flex: 1;
      display: flex;
      img {
        width: 50px;
        height: 50px;
      }
      .info {
        margin-left: 20px;
        h3 {
          font-size: 14px;
          font-family: Microsoft YaHei;
          font-weight: bold;
          line-height: 19px;
          color: #000000;
          margin-bottom: 0;
        }
        .desc {
          font-size: 14px;
          font-family: Microsoft YaHei;
          font-weight: 400;
          line-height: 19px;
          color: #000000;
          margin-top: 6px;
        }
      }
    }
    .item-r {
      display: flex;
      align-items: center;
      background: #FAFAFA;
      width: 230px;
      height: 40px;
      border-radius: 25px;
      margin-left: 100px;
      .title {
        font-size: 16px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        line-height: 21px;
        color: #A8A8A8;
        padding-left: 32px;
      }
      .star {
        display: flex;
        align-items: center;
        margin-left: 14px;
        img {
          display: block;
          width: 20px;
          height: 19px;
          margin-right: 5px;
          &:last-child {
            margin-right: 0;
          }
        }
      }
    }
    &:last-child {
      margin-bottom: 0;
    }
  }
}
</style>
